﻿@model Tasks.UI.Models.ArticleManageModel
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>文章管理</title>
    <link href="@Config.GetCssResourcePath("main.css")" rel="stylesheet" type="text/css" />
    <link href="@Config.GetCssResourcePath("table.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/global.js")" type="text/javascript"></script>
    <script type="text/javascript">

        $(function () {
            initProvince("#ProvinceID");
            initCity("#CityID");
            initTable(".tblStyle1");
        })

        function setState(carCompanyID, state) {
            $("#CarCompanyID").val(carCompanyID);
            goto(state);
        }

        function deleteA(articleID) {
            if (!confirm("你确定要删除吗?")) return;

            $("#ArticleID").val(articleID);
            goto("delete");
        }

        function goto(act) {
            $("#act").val(act);
            $("form").submit();
        }
    </script>
</head>
<body>
    @using (Html.BeginForm())
    {
        <input id="act" name="act" type="hidden" />
        <input id="ArticleID" name="ArticleID" type="hidden" />
        <div id="container">
            <div class="navTitle">
                文章管理</div>
            <div class="searchBar">
                <table>
                    <tr align="left">
                        <td>
                            标题：@Html.TextBoxFor(t => t.Title)
                            <input id="Submit1" type="button" value="查询" onclick="goto('search')" class="btnSearch" />
                            <a href="javascript:void(0)" onclick="parent.showModalDialog('/SystemSetting/EditArticle',true)">
                                添加</a>
                        </td>
                    </tr>
                </table>
                <div class="bottom">
                </div>
            </div>
            <table border="0" cellspacing="0" cellpadding="0" class="tblStyle1">
                <thead>
                    <tr align="center">
                        <th style="width: 220px">
                            标题
                        </th>
                        <th style="width: 220px">
                            创建时间
                        </th>
                        <th style="width: 120px">
                            创建人
                        </th>
                        <th style="width: 100px">
                            操作
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (Article article in Model.Articles)
                    {
                        
                        <tr align="center">
                            <td>
                                @article.Title
                            </td>
                            <td>
                                @article.CreateTime
                            </td>
                            <td>
                                @article.CreateUserName
                            </td>
                            <td width="200" valign="bottom">
                                <a href="javascript:deleteA(@article.ID)">删除</a> <a href="javascript:parent.showModalDialog('/SystemSetting/EditArticle?ID=@article.ID',true)">
                                    修改</a>
                            </td>
                        </tr>
                        
                    }
                </tbody>
            </table>
        </div>
        @Html.RenderPageNav(Model.PageIndex, Model.PageSize, Model.RowCount, "", PageNavStyle.Form)
        
    }
</body>
</html>
